package com.yc.springmvc.bean;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.util.Date;
//import java.time.LocalDate;
import java.util.List;

@Data
public class Person {

    @NotEmpty(message = "账号不能为空")
    @Length(min = 2, max = 16, message = "账号长度必须是2~16个字符")
    String name;
    @Min(8)
    @Max(80)
    Integer age;
    Boolean student;
    @NotEmpty(message = "密码不能为空")
    @Length(min = 6, max = 16, message = "密码长度必须是6~16个字符")
    String pwd;
    @Email
    String email;
    @Pattern(regexp = "1\\d{10}",message = "电话必须是1开头的11数字")
    String phone;
    @Past // 过去时间
    //@Future // 未来时间
    Date birthday;

    Person father;
    Person mather;
    List<Person> friends;

}
